//
//  SuperviseArrageSearchView.swift
//  SBSafetyApp
//
//  Created by Lina on 2023/1/6.
//

import Foundation
import UIKit

class SuperviseArrageSearchView: UIView {
    let netItem = UnarmedSearchItem(withPlaceholder: "机构名称：")
    let startDateItem = UnarmedSearchItem(withPlaceholder: "开始时间：")
    let endDateItem = UnarmedSearchItem(withPlaceholder: "结束时间：")

    let submitBtn = UIButton.createPrimaryLarge("搜索")

    override init(frame: CGRect) {
        super.init(frame: frame)
        backgroundColor = .bg
        setupUI()
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI() {
        addSubview(netItem)
        netItem.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(self.snp.top).offset(10)
            make.height.equalTo(56)
            make.left.right.equalToSuperview()
        }
        
        addSubview(startDateItem)
        startDateItem.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(netItem.snp.bottom)
            make.height.equalTo(56)
            make.left.right.equalToSuperview()
        }
        
        addSubview(endDateItem)
        endDateItem.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(startDateItem.snp.bottom)
            make.height.equalTo(56)
            make.left.right.equalToSuperview()
        }
        
        addSubview(submitBtn)
        submitBtn.snp.makeConstraints { (make) -> Void in
            make.top.equalTo(endDateItem.snp.bottom).offset(31)
            make.height.equalTo(50)
            make.centerX.equalTo(self.snp.centerX)
            make.width.equalTo(ScreenWidth - 20)
        }
    }
}
